package com.lg.product.mapper;

import com.lg.product.entity.SpecParam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 规格参数组下的参数名 Mapper 接口
 * </p>
 *
 * @author song
 * @since 2020-07-22
 */
public interface SpecParamMapper extends BaseMapper<SpecParam> {

    @Select("SELECT * from tb_spec_param WHERE group_id=#{id}")
    List<SpecParam> selectById(Integer id);

    int addSpecParam( SpecParam specParam);

    @Select("DELETE FROM tb_spec_param WHERE group_id=#{groupId}")
    Long deleteGroupIdParam(Long groupId);

    @Select("DELETE FROM tb_spec_param WHERE cid=#{cid}")
    Long deleteParamCid(Long cid);
}
